package Box2D.Collision
{
	import Box2D.Collision.Shapes.b2CircleShape;
	import Box2D.Collision.Shapes.b2EdgeShape;
	import Box2D.Collision.Shapes.b2PolygonShape;
	import Box2D.Common.Math.b2Transform;
	import Box2D.Common.b2Base;

	public class b2Collision
	{
		/// Compute the collision manifold between two circles.
		public static function CollideCircles(manifold:b2Manifold,
			circleA:b2CircleShape, xfA:b2Transform,
			circleB:b2CircleShape, xfB:b2Transform):void{
			b2Base.impl.lib.b2Collision_CollideCircles(manifold.wrapper,circleA.wrapper,xfA.wrapper,circleB.wrapper,xfB.wrapper);
		}
		
		/// Compute the collision manifold between a polygon and a circle.
		public static function CollidePolygonAndCircle(manifold:b2Manifold,
			polygonA:b2PolygonShape,xfA:b2Transform,
			circleB:b2CircleShape,xfB:b2Transform):void{
			b2Base.impl.lib.b2Collision_CollidePolygonAndCircle(manifold.wrapper,polygonA.wrapper,xfA.wrapper,circleB.wrapper,xfB.wrapper);	
		}
		
		/// Compute the collision manifold between two polygons.
		public static function CollidePolygons(manifold:b2Manifold,
			polygonA:b2PolygonShape, xfA:b2Transform,
			polygonB:b2PolygonShape,xfB:b2Transform):void{
			b2Base.impl.lib.b2Collision_CollidePolygons(manifold.wrapper,polygonA.wrapper,xfA.wrapper,polygonB.wrapper,xfB.wrapper);
		}
	
		/// Compute the collision manifold between an edge and a circle.
		public static function CollideEdgeAndCircle(manifold:b2Manifold,
			edgeA:b2EdgeShape,xfA:b2Transform,
			circleB:b2CircleShape,xfB:b2Transform):void{
			b2Base.impl.lib.b2Collision_CollideEdgeAndCircle(manifold.wrapper,edgeA.wrapper,xfA.wrapper,circleB.wrapper,xfB.wrapper);
		}
		
		/// Compute the collision manifold between an edge and a polygon.
		public static function CollideEdgeAndPolygon(manifold:b2Manifold,
			edgeA:b2EdgeShape,xfA:b2Transform,
			polygonB:b2PolygonShape, xfB:b2Transform):void{
			b2Base.impl.lib.b2Collision_CollideEdgeAndPolygon(manifold.wrapper,edgeA.wrapper,xfA.wrapper,polygonB.wrapper,xfB.wrapper);
		}
		
		public static function TestOverlap(a:b2AABB,b:b2AABB):Boolean{
			return b2Base.impl.lib.b2Collision_TestOverlap(a.wrapper,b.wrapper);
		}
	}
}